using System.Data;
using ET;
namespace DA
{
	public class Sector_DAL
	{
	private clsConnect cls = new clsConnect();

	#region Getdata
	public DataTable BindGirdSector(string keywords)
	{
        return cls.Search("sp_tb_Sector_Search", "@KeyWords", keywords);
	}
    //public DataTable BindGirdSectorDetail(int id)
    //{
    //}
	#endregion

	#region Insert
	public bool InsertSector(Sector_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Sector_Alias", data.Sector_Alias);
	cls.AddParameter("@Sector_Name", data.Sector_Name);
	cls.AddParameter("@Sector_User_Add", data.Sector_User_Add);
	cls.AddParameter("@Sector_Date_Add", data.Sector_Date_Add);
	cls.AddParameter("@Sector_Computer_Add", data.Sector_Computer_Add);
	cls.AddParameter("@Sector_User_Modify", data.Sector_User_Modify);
	cls.AddParameter("@Sector_Date_Modify", data.Sector_Date_Modify);
	cls.AddParameter("@Sector_Computer_Modify", data.Sector_Computer_Modify);
    cls.ExecuteNonQuery("sp_tb_Sector_Insert");
	return true;
	}
	#endregion

	#region Update
	public bool UpdateSector(Sector_ET data)
	{
	cls.CreateNewSqlCommand();
	cls.AddParameter("@Sector_ID", data.Sector_ID);
	cls.AddParameter("@Sector_Alias", data.Sector_Alias);
	cls.AddParameter("@Sector_Name", data.Sector_Name);
	cls.AddParameter("@Sector_User_Add", data.Sector_User_Add);
	cls.AddParameter("@Sector_Date_Add", data.Sector_Date_Add);
	cls.AddParameter("@Sector_Computer_Add", data.Sector_Computer_Add);
	cls.AddParameter("@Sector_User_Modify", data.Sector_User_Modify);
	cls.AddParameter("@Sector_Date_Modify", data.Sector_Date_Modify);
	cls.AddParameter("@Sector_Computer_Modify", data.Sector_Computer_Modify);
    cls.ExecuteNonQuery("sp_tb_Sector_Update");
	return true;
	}
	#endregion

	#region Delete
	public bool DeleteSector(int id)
	{
        cls.Delete("sp_tb_Sector_Delete", "@Sector_ID", id);
	return true;
	}
	#endregion
	}
}